#include "stdafx.h"
#include "PlayerAvatar.h"
#include "Controller.h"
#include <OISEvents.h>
#include <OISInputManager.h>
#include <OISKeyboard.h>
#include <OISMouse.h>



#ifndef __Input_h_
#define __Input_h_

class Input : public Controller, public OIS::KeyListener, public OIS::MouseListener, public Ogre::WindowEventListener
{
public:
	Input(Ogre::RenderWindow* window);
	~Input();

	void setPlayerAvatar(PlayerAvatar* avatar);

	virtual bool update(float deltaTime);
	
	bool keyPressed(const OIS::KeyEvent &arg);
	bool keyReleased(const OIS::KeyEvent &arg);
	
	bool mouseMoved( const OIS::MouseEvent &arg );
	bool mousePressed( const OIS::MouseEvent &arg, OIS::MouseButtonID id );
	bool mouseReleased( const OIS::MouseEvent &arg, OIS::MouseButtonID id );

	// Ogre::WindowEventListener
    //Adjust mouse clipping area
    virtual void windowResized(Ogre::RenderWindow* rw);
    //Unattach OIS before window shutdown (very important under Linux)
    virtual void windowClosed(Ogre::RenderWindow* rw);
	
private:
	PlayerAvatar *m_playerAvatar;
	OIS::InputManager *m_inputManager;
	OIS::Mouse*    m_mouse;
    OIS::Keyboard* m_keyboard;
	Ogre::RenderWindow* m_window;
};

#endif //__Input_h_